#    pythonequations is a collection of equations expressed as Python classes
#    Copyright (C) 2008 James R. Phillips
#    2548 Vera Cruz Drive
#    Birmingham, AL 35235 USA
#    email: zunzun@zunzun.com
#
#    License: BSD-style (see LICENSE.txt in main source directory)
#    Version info: $Id: Logarithmic.py 288 2010-12-27 11:40:54Z zunzun.com $

import pythonequations, pythonequations.EquationBaseClasses, pythonequations.ExtraCodeForEquationBaseClasses
import numpy
numpy.seterr(all = 'raise') # numpy raises warnings, convert to exceptions to trap them


class Bradley2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Bradley"
    _HTML = "y = a * ln(-b * ln(x))"
    coefficientDesignatorTuple = ('a', 'b')
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] * log(-1.0 * coeff[1] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * log(-1.0 * b * log(x_in));\n"
        return s



class BradleyTransform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = True
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Bradley Transform"
    _HTML = "y = a * ln(-b * ln(cx + d))"
    coefficientDesignatorTuple = ('a', 'b', 'c', 'd')
    function_cpp_code = 'temp = coeff[0] * log(-1.0 * coeff[1] * log(coeff[2] * _id[_cwo[0]+i] + coeff[3]));'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a * log(-1.0 * b * log(c * x_in + d));\n"
        return s



class CrystalResonatorAgeing2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = False
    RequiresAutoGeneratedInverseForms = False
    _name = "Crystal Resonator Ageing MIL-PRF-55310E"
    _HTML = "y = A(ln(Bt + 1)) + f0"
    coefficientDesignatorTuple = ("A", "B", "f0")
    function_cpp_code = 'temp = coeff[0] * (log(coeff[1] * _id[_cwo[0]+i] + 1.0)) + coeff[2];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = A * (log(B * x_in + 1.0)) + f0;\n"
        return s



class LinearLogarithmic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Linear Logarithmic"
    _HTML = "y = a + b*ln(x)"
    coefficientDesignatorTuple = ("a", "b")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in);\n"
        return s



class QuadraticLogarithmic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quadratic Logarithmic"
    _HTML = "y = a + b*ln(x) + c*ln(x)<sup>2</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c')
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c*pow(log(x_in), 2.0);\n"
        return s



class CubicLogarithmic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Cubic Logarithmic"
    _HTML = "y = a + b*ln(x) + c*ln(x)<sup>2</sup> + d*ln(x)<sup>3</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[3.0]), [3.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c*pow(log(x_in), 2.0) + d*pow(log(x_in), 3.0);\n"
        return s



class QuarticLogarithmic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quartic Logarithmic"
    _HTML = "y = a + b*ln(x) + c*ln(x)<sup>2</sup> + d*ln(x)<sup>3</sup> + f*ln(x)<sup>4</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f')
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[3.0]), [3.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[4.0]), [4.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c*pow(log(x_in), 2.0) + d*pow(log(x_in), 3.0) + f*pow(log(x_in), 4.0);\n"
        return s



class QuinticLogarithmic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quintic Logarithmic"
    _HTML = "y = a + b*ln(x) + c*ln(x)<sup>2</sup> + d*ln(x)<sup>3</sup> + f*ln(x)<sup>4</sup> + g*ln(x)<sup>5</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f', 'g')
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i] + coeff[2] * _id[_cwo[2]+i] + coeff[3] * _id[_cwo[3]+i] + coeff[4] * _id[_cwo[4]+i] + coeff[5] * _id[_cwo[5]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_LogX(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[2.0]), [2.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[3.0]), [3.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[4.0]), [4.0]])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_PowLogX(NameOrValueFlag=1, args=[5.0]), [5.0]])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(x_in) + c*pow(log(x_in), 2.0) + d*pow(log(x_in), 3.0) + f*pow(log(x_in), 4.0) + g*pow(log(x_in), 5.0);\n"
        return s



class Base10Logarithmic2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Base 10 Logarithmic"
    _HTML = "y = a + b*log<SUB>10</SUB>(x)"
    coefficientDesignatorTuple = ("a", "b")
    LinearSSQSolverFlag = 1
    CannotAcceptDataWithZeroX = True
    CannotAcceptDataWithNegativeX = True
    function_cpp_code = 'temp = coeff[0] + coeff[1] * _id[_cwo[1]+i];'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Ones(NameOrValueFlag=1), []])
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_Log10X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log10(x_in);\n"
        return s



class LinearLogarithmicTransform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Linear Logarithmic Transform"
    _HTML = "y = a + b*ln(cx+d)"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[2] * _id[_cwo[0]+i] + coeff[3]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(c * x_in + d);\n"
        return s



class QuadraticLogarithmicTransform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quadratic Logarithmic Transform"
    _HTML = "y = a + b*ln(dx+f) + c*ln(dx+f)<sup>2</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[3] * _id[_cwo[0]+i] + coeff[4]) + coeff[2] * pow(log(coeff[3] * _id[_cwo[0]+i] + coeff[4]), 2.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(d * x_in + f) + c*pow(log(d * x_in + f), 2.0);\n"
        return s



class CubicLogarithmicTransform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Cubic Logarithmic Transform"
    _HTML = "y = a + b*ln(f*x+g) + c*ln(f*x+g)<sup>2</sup> + d*ln(f*x+g)<sup>3</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f', 'g')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[4] * _id[_cwo[0]+i] + coeff[5]) + coeff[2] * pow(log(coeff[4] * _id[_cwo[0]+i] + coeff[5]), 2.0) + coeff[3] * pow(log(coeff[4] * _id[_cwo[0]+i] + coeff[5]), 3.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(f * x_in + g) + c*pow(log(f * x_in + g), 2.0) + d*pow(log(f * x_in + g), 3.0);\n"
        return s



class QuarticLogarithmicTransform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quartic Logarithmic Transform"
    _HTML = "y = a + b*ln(g*x+h) + c*ln(g*x+h)<sup>2</sup> + d*ln(g*x+h)<sup>3</sup> + f*ln(g*x+h)<sup>4</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f', 'g', 'h')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[5] * _id[_cwo[0]+i] + coeff[6]) + coeff[2] * pow(log(coeff[5] * _id[_cwo[0]+i] + coeff[6]), 2.0) + coeff[3] * pow(log(coeff[5] * _id[_cwo[0]+i] + coeff[6]), 3.0) + coeff[4] * pow(log(coeff[5] * _id[_cwo[0]+i] + coeff[6]), 4.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(g * x_in + h) + c*pow(log(g * x_in + h), 2.0) + d*pow(log(g * x_in + h), 3.0) + f*pow(log(g * x_in + h), 4.0);\n"
        return s



class QuinticLogarithmicTransform2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quintic Logarithmic Transform"
    _HTML = "y = a + b*ln(h*x+i) + c*ln(h*x+i)<sup>2</sup> + d*ln(h*x+i)<sup>3</sup> + f*ln(h*x+i)<sup>4</sup> + g*ln(h*x+i)<sup>5</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f', 'g', 'h', 'i')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[6] * _id[_cwo[0]+i] + coeff[7]) + coeff[2] * pow(log(coeff[6] * _id[_cwo[0]+i] + coeff[7]), 2.0) + coeff[3] * pow(log(coeff[6] * _id[_cwo[0]+i] + coeff[7]), 3.0) + coeff[4] * pow(log(coeff[6] * _id[_cwo[0]+i] + coeff[7]), 4.0) + coeff[5] * pow(log(coeff[6] * _id[_cwo[0]+i] + coeff[7]), 5.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(h * x_in + i) + c*pow(log(h * x_in + i), 2.0) + d*pow(log(h * x_in + i), 3.0) + f*pow(log(h * x_in + i), 4.0) + f*pow(log(h * x_in + i), 5.0);\n"
        return s



class LinearLogarithmicScaled2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Linear Logarithmic Scaled"
    _HTML = "y = a + b*ln(cx)"
    coefficientDesignatorTuple = ("a", "b", 'c')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[2] * _id[_cwo[0]+i]);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(c * x_in);\n"
        return s



class QuadraticLogarithmicScaled2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quadratic Logarithmic Scaled"
    _HTML = "y = a + b*ln(dx) + c*ln(dx)<sup>2</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[3] * _id[_cwo[0]+i]) + coeff[2] * pow(log(coeff[3] * _id[_cwo[0]+i]), 2.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(d * x_in) + c*pow(log(d * x_in), 2.0);\n"
        return s



class CubicLogarithmicScaled2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Cubic Logarithmic Scaled"
    _HTML = "y = a + b*ln(f*x) + c*ln(f*x)<sup>2</sup> + d*ln(f*x)<sup>3</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[4] * _id[_cwo[0]+i]) + coeff[2] * pow(log(coeff[4] * _id[_cwo[0]+i]), 2.0) + coeff[3] * pow(log(coeff[4] * _id[_cwo[0]+i]), 3.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(f * x_in) + c*pow(log(f * x_in), 2.0) + d*pow(log(f * x_in), 3.0);\n"
        return s



class QuarticLogarithmicScaled2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quartic Logarithmic Scaled"
    _HTML = "y = a + b*ln(h*x) + c*ln(h*x)<sup>2</sup> + d*ln(h*x)<sup>3</sup> + f*ln(h*x)<sup>4</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f', 'g')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[5] * _id[_cwo[0]+i]) + coeff[2] * pow(log(coeff[5] * _id[_cwo[0]+i]), 2.0) + coeff[3] * pow(log(coeff[5] * _id[_cwo[0]+i]), 3.0) + coeff[4] * pow(log(coeff[5] * _id[_cwo[0]+i]), 4.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(g * x_in) + c*pow(log(g * x_in), 2.0) + d*pow(log(g * x_in), 3.0) + f*pow(log(g * x_in), 4.0);\n"
        return s



class QuinticLogarithmicScaled2D(pythonequations.EquationBaseClasses.Equation2D):
    RequiresAutoGeneratedGrowthAndDecayForms = True
    RequiresAutoGeneratedOffsetForm = False
    RequiresAutoGeneratedReciprocalForm = True
    RequiresAutoGeneratedInverseForms = True
    _name = "Quintic Logarithmic Scaled"
    _HTML = "y = a + b*ln(h*x) + c*ln(h*x)<sup>2</sup> + d*ln(h*x)<sup>3</sup> + f*ln(h*x)<sup>4</sup> + g*ln(h*x)<sup>4</sup>"
    coefficientDesignatorTuple = ("a", "b", 'c', 'd', 'f', 'g', 'h')
    function_cpp_code = 'temp = coeff[0] + coeff[1] * log(coeff[6] * _id[_cwo[0]+i]) + coeff[2] * pow(log(coeff[6] * _id[_cwo[0]+i]), 2.0) + coeff[3] * pow(log(coeff[6] * _id[_cwo[0]+i]), 3.0) + coeff[4] * pow(log(coeff[6] * _id[_cwo[0]+i]), 4.0) + coeff[5] * pow(log(coeff[6] * _id[_cwo[0]+i]), 5.0);'


    def CreateCacheGenerationList(self):
        self.CacheGenerationList = []
        self.CacheGenerationList.append([pythonequations.ExtraCodeForEquationBaseClasses.CG_X(NameOrValueFlag=1), []])

    def SpecificCodeCPP(self):
        s = "\ttemp = a + b*log(h * x_in) + c*pow(log(h * x_in), 2.0) + d*pow(log(h * x_in), 3.0) + f*pow(log(h * x_in), 4.0) + g*pow(log(h * x_in), 5.0);\n"
        return s
